
package anc.server.tankshooter;

import java.io.IOException;
import java.sql.Connection;

import anc.server.tankshooter.database.AccountManager;
import anc.server.tankshooter.database.Connect;
import anc.server.tankshooter.models.Account;
import anc.server.tankshooter.network.DataPacket;
import anc.server.tankshooter.network.Match;
import anc.server.tankshooter.network.Server;

public class App {

	public static final boolean isDebug = false;
	/**
	 * @param args
	 */
	public App() throws IOException
	{
	}
	
	public static void main(String[] args) {
		try {
			new Server();
		} catch (IOException e) {
			printError(e);
			System.out.println("CREATE SOCKET FAILED");
		}
		
	}
	
	/**
	 * In ra chi tiết lỗi nếu như App.isDebug = true;
	 * @param ex
	 */
	public static final void printError(Exception ex){
		if(App.isDebug) {
			System.out.println("\n----------------------------------------------------------");
			System.out.println(ex.getMessage());
			ex.printStackTrace(System.out);
			System.out.println("----------------------------------------------------------");
		}
	}
	
	/**
	 * 
	 */
	
	public static final void printCommand(DataPacket packet)
	{
		System.out.println("Command: " + packet.getCommand() + ", " + "Data: "+ packet.getValue());
	}
	
	public static final void printString(String st)
	{
		System.out.println(st);
	}

}
